package com.course.gateway;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.core.env.ConfigurableEnvironment;

@SpringBootApplication
@EnableEurekaClient
public class GatewayApplication {
    private static final Logger log = LoggerFactory.getLogger(GatewayApplication.class);

    public static void main(String[] args) {
//        SpringApplication.run(EurekaApplication.class, args);
        ConfigurableEnvironment environment = new SpringApplication(GatewayApplication.class).run(args).getEnvironment();
        log.info("gateway地址：http://127.0.0.1:{}", environment.getProperty("server.port"));
    }
}
